package com.cloudfun.campusshare.common.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.groups.Default;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "登录信息")
public class SessionVO {

    @ApiModelProperty(value = "手机号")
    @NotEmpty(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty(value = "密码")
    @NotEmpty(message = "密码不能为空")
    @Length(max = 20, message = "密码限制20个字")
    private String password;

    @ApiModelProperty(value = "验证码")
    @NotEmpty(message = "验证码不能为空", groups = {Captcha.class})
    private String captcha;

    public static interface Captcha extends Default {

    }
}
